<!DOCTYPE html>
<html>
  <!-- Html Head Tag-->
  <head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="Rms">
  <!-- Open Graph Data -->
  <meta property="og:title" content="SpringCloud新建一个父工程"/>
  <meta property="og:description" content="" />
  <meta property="og:site_name" content="帅的一逼"/>
  <meta property="og:type" content="article" />
  <meta property="og:image" content="http://shsa.gitee.io"/>
  
    <link rel="alternate" href="/atom.xml" title="帅的一逼" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  

  <!-- Site Title -->
  <title>帅的一逼</title>

  <!-- Bootstrap CSS -->
  
<link rel="stylesheet" href="/myblog/css/bootstrap.min.css">

  <!-- Custom CSS -->
  
  
<link rel="stylesheet" href="/myblog/css/style.light.css">


  <!-- Google Analytics -->
  

<meta name="generator" content="Hexo 4.2.1"></head>

  <body>
    <!-- Page Header -->


<header class="site-header header-background" style="background-image: url(/myblog//img/i.jpg)">
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <div class="page-title with-background-image">
          <p class="title">SpringCloud新建一个父工程</p>
          <p class="subtitle"></p>
        </div>
        <div class="site-menu with-background-image">
          <ul>
            
              <li>
                <a href="/myblog/">
                  
                  Home
                  
                </a>
              </li>
            
              <li>
                <a href="/myblog/archives">
                  
                  Archives
                  
                </a>
              </li>
            
              <li>
                <a href="/myblog/about">
                  
                  About
                  
                </a>
              </li>
            
          </ul>
        </div>
      </div>
    </div>
  </div>
</header>

<article>
  <div class="container typo">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <div class="post-info text-muted">
          
            <!-- Author -->
            <span class="author info">By Rms</span>
          
          <!-- Date -->
          <span class="date-time info">On
            <span class="date">2020-06-30</span>
            <span class="time">21:53:53</span>
          </span>
          
        </div>
        <!-- Tags -->
        
        <!-- Post Main Content -->
        <div class="post-content">
          <h1 id="SpringColoud新建父工程"><a href="#SpringColoud新建父工程" class="headerlink" title="SpringColoud新建父工程"></a>SpringColoud新建父工程</h1><h3 id="1-使用maven项目搭建"><a href="#1-使用maven项目搭建" class="headerlink" title="1.使用maven项目搭建"></a>1.使用maven项目搭建</h3><p><img src="https://pic.baixiongz.com/2020/06/30/648071bc382bc.png" alt="image-20200630092725335.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/9157afbde1ced.png" alt="image-20200630092927662.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/f4aae457cd1f3.png" alt="image-20200630093028280.png"></p>
<h3 id="2-用spring-boot项目搭建"><a href="#2-用spring-boot项目搭建" class="headerlink" title="2.用spring boot项目搭建"></a>2.用spring boot项目搭建</h3><ol>
<li>新建一个spring boot项目src删除留下pom文件和文件名</li>
<li>新建一个MODEL就是一个父工程了</li>
</ol>
<h3 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项:"></a>注意事项:</h3><p><img src="https://pic.baixiongz.com/2020/06/30/b43334d225d78.png" alt="image-20200630093431856.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/6df5590b7baa2.png" alt="image-20200630093727569.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/9720dff5a2276.png" alt="image-20200630093908628.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/4cea9b26aeb66.png" alt="image-20200630094231223.png"></p>
<p><img src="https://pic.baixiongz.com/2020/06/30/2808515a6de07.png" alt="image-20200630094603763.png"></p>
<h3 id="执行install命令"><a href="#执行install命令" class="headerlink" title="执行install命令:"></a>执行install命令:</h3><p><img src="https://pic.baixiongz.com/2020/06/30/dea923b46ee17.png" alt="image-20200630093139860.png"></p>
<h3 id="父类文件的pom-xml"><a href="#父类文件的pom-xml" class="headerlink" title="父类文件的pom.xml:"></a>父类文件的pom.xml:</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br></pre></td><td class="code"><pre><span class="line">&lt;?xml version=<span class="string">"1.0"</span> encoding=<span class="string">"UTF-8"</span>?&gt;</span><br><span class="line">&lt;project xmlns=<span class="string">"http://maven.apache.org/POM/4.0.0"</span> xmlns:xsi=<span class="string">"http://www.w3.org/2001/XMLSchema-instance"</span></span><br><span class="line">         xsi:schemaLocation=<span class="string">"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"</span>&gt;</span><br><span class="line">    &lt;modelVersion&gt;<span class="number">4.0</span><span class="number">.0</span>&lt;<span class="regexp">/modelVersion&gt;</span></span><br><span class="line"><span class="regexp">    &lt;parent&gt;</span></span><br><span class="line"><span class="regexp">        &lt;groupId&gt;org.springframework.boot&lt;/g</span>roupId&gt;</span><br><span class="line">        &lt;artifactId&gt;spring-boot-starter-parent&lt;<span class="regexp">/artifactId&gt;</span></span><br><span class="line"><span class="regexp">        &lt;version&gt;2.3.1.RELEASE&lt;/</span>version&gt;</span><br><span class="line">        &lt;relativePath/&gt; &lt;!-- lookup parent <span class="keyword">from</span> repository --&gt;</span><br><span class="line">    &lt;<span class="regexp">/parent&gt;</span></span><br><span class="line"><span class="regexp">    &lt;groupId&gt;com.seng&lt;/g</span>roupId&gt;</span><br><span class="line">    &lt;artifactId&gt;springcloud&lt;<span class="regexp">/artifactId&gt;</span></span><br><span class="line"><span class="regexp">    &lt;version&gt;0.0.1-SNAPSHOT&lt;/</span>version&gt;</span><br><span class="line">    &lt;name&gt;springcloud&lt;<span class="regexp">/name&gt;</span></span><br><span class="line"><span class="regexp">    &lt;packaging&gt;pom&lt;/</span>packaging&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    &lt;!--统一管理jar包版本--&gt;</span><br><span class="line">    &lt;properties&gt;</span><br><span class="line">        &lt;project.build.sourceEncoding&gt;UTF<span class="number">-8</span>&lt;<span class="regexp">/project.build.sourceEncoding&gt;</span></span><br><span class="line"><span class="regexp">        &lt;maven.compiler.source&gt;12&lt;/m</span>aven.compiler.source&gt;</span><br><span class="line">        &lt;maven.compiler.target&gt;<span class="number">12</span>&lt;<span class="regexp">/maven.compiler.target&gt;</span></span><br><span class="line"><span class="regexp">        &lt;junit.version&gt;4.12&lt;/</span>junit.version&gt;</span><br><span class="line">        &lt;lombok.version&gt;<span class="number">1.18</span><span class="number">.10</span>&lt;<span class="regexp">/lombok.version&gt;</span></span><br><span class="line"><span class="regexp">        &lt;log4j.version&gt;1.2.17&lt;/</span>log4j.version&gt;</span><br><span class="line">        &lt;mysql.version&gt;<span class="number">8.0</span><span class="number">.18</span>&lt;<span class="regexp">/mysql.version&gt;</span></span><br><span class="line"><span class="regexp">        &lt;druid.version&gt;1.1.16&lt;/</span>druid.version&gt;</span><br><span class="line">        &lt;mybatis.spring.boot.version&gt;<span class="number">1.3</span><span class="number">.0</span>&lt;<span class="regexp">/mybatis.spring.boot.version&gt;</span></span><br><span class="line"><span class="regexp">    &lt;/</span>properties&gt;</span><br><span class="line"></span><br><span class="line">    &lt;!-- 子模块继承之后，提供作用：锁定版本+子modlue不用写groupId和version  --&gt;</span><br><span class="line">    &lt;dependencyManagement&gt;</span><br><span class="line">        &lt;dependencies&gt;</span><br><span class="line">            &lt;!--spring boot <span class="number">2.2</span><span class="number">.2</span>--&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;org.springframework.boot&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;spring-boot-dependencies&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;<span class="number">2.2</span><span class="number">.2</span>.RELEASE&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">                &lt;type&gt;pom&lt;/</span>type&gt;</span><br><span class="line">                &lt;scope&gt;<span class="keyword">import</span>&lt;<span class="regexp">/scope&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;!--spring cloud Hoxton.SR1--&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;org.springframework.cloud&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;spring-cloud-dependencies&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;Hoxton.SR1&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">                &lt;type&gt;pom&lt;/</span>type&gt;</span><br><span class="line">                &lt;scope&gt;<span class="keyword">import</span>&lt;<span class="regexp">/scope&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;!--spring cloud alibaba <span class="number">2.1</span><span class="number">.0</span>.RELEASE--&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;com.alibaba.cloud&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;spring-cloud-alibaba-dependencies&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;<span class="number">2.1</span><span class="number">.0</span>.RELEASE&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">                &lt;type&gt;pom&lt;/</span>type&gt;</span><br><span class="line">                &lt;scope&gt;<span class="keyword">import</span>&lt;<span class="regexp">/scope&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line"></span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;mysql&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;mysql-connector-java&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;mysql.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;com.alibaba&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;druid&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;druid.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;org.mybatis.spring.boot&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;mybatis.spring.boot.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;junit&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;junit&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;junit.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;log4j&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;log4j&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;log4j.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">            &lt;/</span>dependency&gt;</span><br><span class="line">            &lt;dependency&gt;</span><br><span class="line">                &lt;groupId&gt;org.projectlombok&lt;<span class="regexp">/groupId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;artifactId&gt;lombok&lt;/</span>artifactId&gt;</span><br><span class="line">                &lt;version&gt;$&#123;lombok.version&#125;&lt;<span class="regexp">/version&gt;</span></span><br><span class="line"><span class="regexp">                &lt;optional&gt;true&lt;/</span>optional&gt;</span><br><span class="line">            &lt;<span class="regexp">/dependency&gt;</span></span><br><span class="line"><span class="regexp">        &lt;/</span>dependencies&gt;</span><br><span class="line">    &lt;<span class="regexp">/dependencyManagement&gt;</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">    &lt;build&gt;</span></span><br><span class="line"><span class="regexp">        &lt;plugins&gt;</span></span><br><span class="line"><span class="regexp">            &lt;plugin&gt;</span></span><br><span class="line"><span class="regexp">                &lt;groupId&gt;org.springframework.boot&lt;/g</span>roupId&gt;</span><br><span class="line">                &lt;artifactId&gt;spring-boot-maven-plugin&lt;<span class="regexp">/artifactId&gt;</span></span><br><span class="line"><span class="regexp">                &lt;configuration&gt;</span></span><br><span class="line"><span class="regexp">                    &lt;fork&gt;true&lt;/</span>fork&gt;</span><br><span class="line">                    &lt;addResources&gt;<span class="literal">true</span>&lt;<span class="regexp">/addResources&gt;</span></span><br><span class="line"><span class="regexp">                &lt;/</span>configuration&gt;</span><br><span class="line">            &lt;<span class="regexp">/plugin&gt;</span></span><br><span class="line"><span class="regexp">        &lt;/</span>plugins&gt;</span><br><span class="line">    &lt;<span class="regexp">/build&gt;</span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp">&lt;/</span>project&gt;</span><br></pre></td></tr></table></figure>


        </div>
      </div>
    </div>
  </div>
</article>



    <!-- Footer -->
<footer>
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <p class="copyright text-muted">
          Theme By <a target="_blank" href="https://github.com/levblanc">Levblanc.</a>
          Inspired By <a target="_blank" href="https://github.com/klugjo/hexo-theme-clean-blog">Clean Blog.</a>
        <p class="copyright text-muted">
          Powered By <a target="_blank" href="https://hexo.io/">Hexo.</a>
        </p>
      </div>
    </div>
  </div>
</footer>


    <!-- After Footer Scripts -->

<script src="/myblog/js/highlight.pack.js"></script>

<script>
  document.addEventListener("DOMContentLoaded", function(event) {
    var codeBlocks = Array.prototype.slice.call(document.getElementsByTagName('pre'))
    codeBlocks.forEach(function(block, index) {
      hljs.highlightBlock(block);
    });
  });
</script>

  </body>
</html>

